﻿@{
    ViewBag.Title = "报废记录";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section scripts{
    <script src="~/Areas/Dev/ViewModels/Dev.viewModel.search.js"></script>
    <script type="text/javascript">
         var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            var viewModel = function(data){ 
                var self = this;
                Dev.viewModel.search.apply(self,arguments);
            } 
            
            ko.bindingViewModel(new viewModel(data));

            //格式化checkbox true false
            frmatCheckboxs = function (value) {
                var checked = (value || 'false').toString() == 'passed';
                return utils.formatString('<img value={0} src="/Content/images/{1}"/>', checked, checked ? "checkmark.gif" : "checknomark.gif");
            };
    </script>
}
<div class="z-toolbar">
    <a id="a_refresh" href="#" plain="true" class="easyui-linkbutton" icon="icon-arrow_refresh"title="刷新" data-bind="click:refreshClick">刷新</a> 
    <a id="a_add" href="#" plain="true" class="easyui-linkbutton" icon="icon-add" title="新增" data-bind="click:addClick">新增</a> 
    <a id="a_edit" href="#" plain="true" class="easyui-linkbutton" icon="icon-edit" data-bind="click:editClick" title="编辑">编辑</a> 
    <a id="a_del" href="#" plain="true" class="easyui-linkbutton" icon="icon-cross" title="删除" data-bind="click:deleteClick"> 删除</a> 
    <a id="a_audit" href="#" plain="true" class="easyui-linkbutton" icon="icon-user-accept" data-bind="click:auditClick" title="审核">审核</a>
    <a id="a_export" href="#" class="easyui-splitbutton" data-options="menu:'#dropdown',iconCls:'icon-download'">导出</a>
</div>

<div id="dropdown" style="width: 100px; display: none;">
    <div data-options="iconCls:'icon-ext-xls'" suffix="xls" data-bind="click:downloadClick">Excel2003</div>
    <div data-options="iconCls:'icon-page_excel'" suffix="xlsx" data-bind="click:downloadClick">Excel2007</div>
    <div data-options="iconCls:'icon-ext-doc'" suffix="doc" data-bind="click:downloadClick">Word2003</div>
</div>

<div id="condition" class="container_12" style="position: relative;">

    <div class="grid_1 lbl">报废单号</div>
    <div class="grid_2 val">
        <input type="text" data-bind="value:form.Bfjl_BillNo" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Bdjl/getbillno'" />
    </div>
    <div class="grid_1 lbl">报废日期</div>
    <div class="grid_2 val">
        <input type="text" data-bind="value:form.Bfjl_Bfrq" class="z-txt easyui-daterange"/>
    </div>

    <div class="clear"></div>

    <div class="grid_1 lbl">经办人</div>
    <div class="grid_2 val">
        <input type="text" data-bind="value:form.Bfjl_Jbry" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Bdjl/GetDoNames'" />
    </div>
    <div class="grid_1 lbl">审核人</div>
    <div class="grid_2 val">
        <input type="text" data-bind="value:form.ApprovePerson" class="z-txt easyui-autocomplete" data-options="url:'/api/dev/Bdjl/GetApNames'" />
    </div>

    <div class="clear"></div>

    <div class="prefix_9" style="position: absolute; top: 5px; height: 0;">
        <a id="a_search" href="#" class="button button-blue" style="margin: 0 15px;" data-bind="click:searchClick">查询</a> 
        <a id="a_reset" href="#" class="button button-blue" data-bind="click:clearClick">清空</a>
    </div>

</div>

<table id="gridlist" data-bind="datagrid:grid">
    <thead>
        <tr>
            <th field="Bfjl_BillNo" sortable="true" align="left" width="100">报废单号</th>
            <th field="Bfjl_Bfrq" sortable="true" align="center" formatter="com.formatDate" width="90">报废日期</th>
            <th field="Sbda_Sbmc" sortable="true" align="left" width="100">设备</th>
            <th field="Bfjl_Ybmmc" sortable="true" align="left" width="90">原部门名称</th>
            <th field="Bfjl_Bmmc" sortable="true" align="left" width="90">经办部门</th>
            <th field="Bfjl_Jbry" sortable="true" align="left" width="80">经办人</th>
            <th field="Bfjl_Djly" sortable="true" align="left" width="80">单据来源</th>
            <th field="Bfjl_Bfyy" sortable="true" align="left" width="320">报废原因</th>
            <th field="Bfjl_Sl" sortable="true" align="right" width="60">数量</th>
            <th field="Bfjl_Synx" sortable="true" align="right" width="60">使用年限</th>
            <th field="Bfjl_Bfsr" sortable="true" align="right" width="80">报废收入</th>
            <th field="Bfjl_Qlfy" sortable="true" align="right" width="80">清理费用</th>
            <th field="CreatePerson" sortable="true" align="left" width="80">创建人</th>
            <th field="CreateDate" sortable="true" align="center" formatter="com.formatDate" width="90">创建时间</th>
            <th field="UpdatePerson" sortable="true" align="left" width="80">更新人</th>
            <th field="UpdateDate" sortable="true" align="center" formatter="com.formatDate" width="90">更新时间</th>
            <th field="ApproveState" sortable="true" align="center" formatter="frmatCheckboxs" width="90">审核状态</th>
            <th field="ApproveDate" sortable="true" align="center" formatter="com.formatDate" width="90">审核时间</th>
            <th field="ApproveRemark" sortable="true" align="left" width="320">审核说明</th>
            <th field="Bfjl_Remark" sortable="true" align="left" width="320">备注说明</th>
        </tr>
    </thead>
</table>